package com.r_z.mapper;

import org.apache.ibatis.annotations.*;
import com.r_z.entity.FinancialRevenue;

import java.util.List;
import java.util.Map;

/**
 * 财务收入
 * @author :yimeng
 * @date :2023/5/30  8:52
 * @description:some description
 */
@Mapper
public interface FinancialRevenueMapper {
    /**
     * 根据主键ID查询财务信息
     * @param fRevenueId
     * @return
     */
    @Select("select * from financialRevenue where fRevenueId = #{fRevenueId}")
    List<FinancialRevenue> selectAllFinancialRevenue(String fRevenueId);

    /**
     * 根据条件分页查询
     * @param map
     * @return
     */
    @Select("select * from financialRevenue where 1=1 ${strWhere} limit #{page},#{limit}")
    List<FinancialRevenue> LimitFinancialRevenue(Map map);

    /**
     * 根据条件查询总行数
     * @param map
     * @return
     */
    @Select("select count(*) from financialRevenue where 1=1 ${strWhere}")
    int countFinancialRevenue(Map map);

    /**
     * 添加财务收入信息
     * @param financialRevenue
     * @return
     */
    @Insert("INSERT INTO financialRevenue VALUES(#{fRevenueId},#{salesOrderId},#{money},#{dataTime},#{auditState},#{state},#{type},#{describes})")
    int insertFinancialRevenue(FinancialRevenue financialRevenue);

    /**
     * 根据主键ID进行删除财务收入信息
     * @param fRevenueId
     * @return
     */
    @Delete("delete from financialRevenue where fRevenueId = #{fRevenueId}")
    int deleteFinancialRevenue(String fRevenueId);

    /**
     * 批量删除
     * @param fRevenueId
     * @return
     */
    int deleteFinancialRevenueById(List fRevenueId);

    /**
     * 根据主键ID进行修改财务收入信息
     * @param financialRevenue
     * @return
     */
    @Update("update financialRevenue set salesOrderId=#{salesOrderId},money=#{money},dataTime=#{dataTime},auditState=#{auditState},state = #{state},type=#{type},describes = #{describes} where fRevenueId = #{fRevenueId}")
    int updateFinancialRevenue(FinancialRevenue financialRevenue);

}
